/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function calTime(){
    var currentETime = new Date();
    var eTime = currentETime.getTime();
    $('#responseTime').html(eTime - sTime);
}
var sTime;
function startTime(){
    var currentSTime = new Date();
    sTime = currentSTime.getTime();
    $('#responseTime').html("<img src=\"./images/loader.gif\" />");
}

 

function loadBinIncoming(){
    $.blockUI();
 $.post("BinIncomingServlet",{
        action: "loadBinIncoming"
    },
    function(data){

            $('#binincominglist').html(data);

    },
    "html"

    );
  //เรียกใช้ BlockUI
}
function loadFCBinIncoming(){
    $.blockUI();
 $.post("BinIncomingServlet",{
        action: "loadFCBinIncoming"
    },
    function(data){

            $('#forecastbinincominglist').html(data);

    },
    "html"

    );
  //เรียกใช้ BlockUI
}



function loadSliderTable(bin){

    startTime();
    $("#showTable").html("<img src=\"./images/loader.gif\" />");
    $("#showTable").load("BinIncomingServlet?action=loadSliderTable").hide().fadeIn('slow');
    calTime();


}

$(document).ready(function()
{
     jQuery("#selectbin").validationEngine('attach', {
        onValidationComplete: function(form, status){
            if(status){


                            $.blockUI();
                                $.post(
                                    "BinIncomingServlet",
                                    {
                                        action: "loadSliderTable",
                                        bin: $("#bin").val()
                                    },
                                    function(data){
                                       $("#showTable").html(data).hide().fadeIn('slow');
                                    },
                                    "html"

                                    );







            }
        }
    });

   
                 
});
$(document).ready(function()
{
     jQuery("#selectforecastbin").validationEngine('attach', {
        onValidationComplete: function(form, status){
            if(status){


                            $.blockUI();
                                $.post(
                                    "BinIncomingServlet",
                                    {
                                        action: "loadSliderTable2",
                                        bin: $("#fcbin").val()
                                    },
                                    function(data){
                                       $("#showTable").html(data).hide().fadeIn('slow');
                                    },
                                    "html"

                                    );







            }
        }
    });



});